<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        /*class类属性选择器*/
        .container {
            width: 400px;
            height: 400px;
            background-color: #f5f5f5;
        }
        /*后代选择器*/
        .container .product {
            width: 234px;
            height: 300px;
            background-color: #fff;
            /*文本或者行内元素内容水平居中对齐*/
            text-align: center;
            /*块元素水平居中对齐*/
            margin: 0 auto;
        }
        .container .product img{
            width: 160px;
        }
        .container .product #title{
            font-size: 14px;
            font-weight: normal;
            height: 25px;
        }
        .container .product .sub-title{
            font-size: 12px;
            font-weight: normal;
            height: 30px;
        }
        .container .product .price{
            font-size: 14px;
            color: #ffa500;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="product">
        <img src="img/car.jpg" alt="">
        <h3 id="title">九号平衡车</h3>
        <h4 class="sub-title">成年人的玩具</h4>
        <p class="price">1999元</p>
    </div>
</div>
</body>
</html>
